{% extends 'base.html' %}
{% block title %}添加角色{% endblock %}
{% block content %}
<div class="mt-4">
    <h1>添加角色</h1>
    <form method="POST" class="mt-3">
        <div class="form-group">
            <label for="name">角色名称</label>
            <input type="text" class="form-control" id="name" name="name" required>
        </div>
        <div class="form-group">
            <label>权限</label>
            {% for perm in permissions %}
            <div class="form-check">
                <input type="checkbox" class="form-check-input" name="permissions" value="{{ perm.id }}" id="perm_{{ perm.id }}">
                <label class="form-check-label" for="perm_{{ perm.id }}">{{ perm.name }}</label>
            </div>
            {% endfor %}
        </div>
        <button type="submit" class="btn btn-primary">添加</button>
        <a href="{{ url_for('admin_manage') }}" class="btn btn-secondary">返回</a>
    </form>
</div>
{% endblock %}